
import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author tsuchimoto
 */
public class View extends Canvas
{
    private Timer m_Timer;
    private int m_X;

    public View()
    {
        m_Timer=new Timer();
        m_Timer.scheduleAtFixedRate(new Task(),0, 100);
    }

    protected void paint(Graphics aGraphics)
    {
        aGraphics.setColor(0xffffff);
        aGraphics.fillRect(0, 0, getWidth(), getHeight());
        aGraphics.setColor(0x000000);
        aGraphics.fillRect(m_X, 0, 100, 100);
    }

    public void resume()
    {

    }

    class Task extends TimerTask
    {
        public void run()
        {
            m_X  = (m_X+1) % 200;
            repaint();
        }
    }
}
